package com.cari.oa.domain;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统用户实体类
 * User: yexuhui
 * Date: 12-12-10
 * Time: 下午3:00
 */
@Entity
@Table(name = "T_SYS_USER")
public class SysUserEntity implements Serializable {

    private static final long serialVersionUID = -3981357062740231828L;

    @Id
    @Length(max = 32)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    private String id;

    @NotNull(message = "英文名不能为空")
    @Length(max = 32, min = 4, message = "英文名长度在4~32个字符之间")
    private String enname;

    @Length(max = 32, min = 2, message = "中文名长度在2~32个字符之间")
    private String cnname;

    @NotNull(message = "密码不能为空")
    @Length(max = 32)
    private String password;

    @Length(max = 50, message = "手机号长度要小于50个字符")
    private String mobile;

    @Email(message = "Email格式不匹配")
    private String email;
    
    @Length(max = 150, message = "省份不能大于150个字符")
    private String province;

	@NotNull
    private Integer status = 0;

    @Column(name = "create_time")
    private Date createTime = new Date();

    private String remark;
    
    @Column(name = "deptNo")
    private String deptNo;
    
    /*
     * 2013-03-18 新增字段phone，通讯录需求  
     * modify by Heyyroup
     */
    @Column(name="phone")
    @Length(max = 50, message = "电话长度要小于50个字符")
    private String phone;		//办公电话
    public String getDeptNo() {
		return deptNo;
	}

	public void setDeptNo(String deptNo) {
		this.deptNo = deptNo;
	}

	public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname;
    }

    public String getCnname() {
        return cnname;
    }

    public void setCnname(String cnname) {
        this.cnname = cnname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
    
    public String getProvince() {
  		return province;
  	}

  	public void setProvince(String province) {
  		this.province = province;
  	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
}
